package com.starsea.book.ui.newpage.adapter

import android.content.Context
import android.view.ViewGroup
import com.starsea.book.base.adapter.ItemViewHolder
import com.starsea.book.base.adapter.RecyclerAdapter
import com.starsea.book.databinding.ItemSignReadCoinBinding
import com.starsea.book.ui.newpage.entity.AwardInfo
import com.starsea.book.ui.newpage.utils.finialDouble
import com.starsea.book.ui.widget.recycler.ItemTouchCallback

class SignReadCoinAdapter(
    context: Context
) :
    RecyclerAdapter<AwardInfo, ItemSignReadCoinBinding>(context),
    ItemTouchCallback.Callback {


    override fun getViewBinding(parent: ViewGroup): ItemSignReadCoinBinding {
        return ItemSignReadCoinBinding.inflate(inflater, parent, false)
    }

    override fun registerListener(holder: ItemViewHolder, binding: ItemSignReadCoinBinding) {

    }

    override fun convert(
        holder: ItemViewHolder,
        binding: ItemSignReadCoinBinding,
        item: AwardInfo,
        payloads: MutableList<Any>
    ) {

        binding.run {
            tvNum.text = (item.amount ?: "0").toDouble().finialDouble()
        }


    }


}